<ui:composition template="/admin/templates/ui2.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:composite="http://java.sun.com/jsf/composite/primefaces"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:sec="http://www.springframework.org/security/facelets/tags">

	<ui:define name="content">
		<div class="entry">
			<p:toolbar>
				<p:toolbarGroup>
					<h:outputLabel style="padding-left: 15px;" value="当前位置：都有啥菜"></h:outputLabel>
				</p:toolbarGroup>
				<p:toolbarGroup align="right">
					<p:separator />
					<p:button value="加个菜" outcome="/admin/order/foodEdit"></p:button>
				</p:toolbarGroup>
			</p:toolbar>
			<h:form id="form">

				<p:spacer></p:spacer>

				<p:spacer></p:spacer>
				<!-- 数据列表 -->
				<p:dataTable id="dataTable" value="#{foodList.lazyModel}" var="food"
					paginator="true" paginatorPosition="bottom"
					rowsPerPageTemplate="15,50,100" rows="100" lazy="true"
					emptyMessage="#{commonMsg.noResultMsg}"
					currentPageReportTemplate="#{commonMsg.pageReportTemplate}"
					sortBy="food.id" sortOrder="ascending"
					paginatorTemplate="#{commonMsg.paginatorTemplate}">
					<p:column>
						<f:facet name="header">
							<h:outputText value="编号"></h:outputText>
						</f:facet>
						<h:outputText value="#{food.id}"></h:outputText>
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="蔡明"></h:outputText>
						</f:facet>
						<h:outputText value="#{food.name}"></h:outputText>
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="蔡明自拍"></h:outputText>
						</f:facet>
						<h:outputText value="#{food.picture}"></h:outputText>
					</p:column>


					<p:column headerText="#{commonMsg.actionLabel}" exportable="false">
						<h:link value="编辑" outcome="/admin/order/foodEdit?id=#{food.id}"></h:link>
						<p:spacer></p:spacer>
					&#160;&#160;
					<p:spacer></p:spacer>
						<p:commandLink value="删除" update="@form"
							onstart="return confirm('您确定要删除？')"
							action="#{foodHome.delete(food.id)}"></p:commandLink>
					</p:column>
					<f:facet name="footer">
						<p:commandButton value="导出Excel" ajax="false">
							<p:dataExporter target="dataTable" type="xls" fileName="foods"
								pageOnly="false"></p:dataExporter>
						</p:commandButton>
					</f:facet>
				</p:dataTable>
			</h:form>
		</div>
	</ui:define>
</ui:composition>

